//
//  Comment.h
//  XPhoto
//
//  Created by baboy on 2019/7/4.
//  Copyright © 2019 baboy. All rights reserved.
//

#import "Model.h"
#import "User.h"
NS_ASSUME_NONNULL_BEGIN

#define API_COMMENT_ADD @"comment_add"
#define API_COMMENT_SEARCH @"comment_search"

@interface CommentSearchArgs : Model
@property(nonatomic, assign) NSInteger postId;
@property(nonatomic, assign) NSInteger refId;
@property(nonatomic, assign) NSInteger minId;
@property(nonatomic, assign) NSInteger maxId;

@end

@interface Comment : Model
@property(nonatomic, assign) NSInteger id;
@property(nonatomic, assign) NSInteger postId;
@property(nonatomic, assign) NSInteger replyTo;
@property(nonatomic, assign) NSInteger refId;
@property(nonatomic, assign) NSInteger uid;
@property(nonatomic, strong) User *user;
@property(nonatomic, strong) Comment *ref;
@property(nonatomic, strong) NSString *content;
@property(nonatomic, strong) NSDate *createTime;
@property(nonatomic, assign) NSInteger replyCount;
@property(nonatomic, strong) NSArray *replyComments;


+ (id)add:(Comment*)comment callback:(nullable void (^)(id _Nonnull task, id _Nullable json,  NSError * _Nullable error))callback;
+ (id)searchWithArgs:(CommentSearchArgs *)args callback:(nullable void (^)(id _Nonnull task, id _Nullable json,  NSError * _Nullable error))callback;
@end

NS_ASSUME_NONNULL_END
